/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.bbs.bean;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "bbs_title_info")
public class BbsTitleInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "BbsTitleInfo";
	public static final String ALIAS_TITLE_ID = "帖子id";
	public static final String ALIAS_TITLE_TITLE = "帖子主题";
	public static final String ALIAS_TITLE_DETAIL = "帖子内容";
	public static final String ALIAS_TITLE_CREATE_TIME = "帖子发表时间";
	public static final String ALIAS_TITLE_STATUS = "帖子状态";
	public static final String ALIAS_TITLE_REPLY_NUM = "帖子回复数";
	public static final String ALIAS_TITLE_LAST_REPLY_USERID = "帖子最后回复用户id";
	public static final String ALIAS_TITLE_LAST_REPLY_USERNAME = "最后回复用户";
	public static final String ALIAS_TITLE_LAST_REPLY_TIME = "最后回复时间";
	public static final String ALIAS_TITLE_USERID = "帖子发表人";
	public static final String ALIAS_TITLE_BLOCKID = "版块id";
	public static final String ALIAS_TITLE_ISTOP = "是否置顶（0：置顶，1：不置顶）";
	public static final String ALIAS_TITLE_USERNAME = "帖子发表用户名称";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 帖子id       db_column: title_id 
     */ 	
	
	private java.lang.Integer titleId;
    /**
     * 帖子主题       db_column: title_title 
     */ 	
	@NotBlank @Length(max=100)
	private java.lang.String titleTitle;
    /**
     * 帖子内容       db_column: title_detail 
     */ 	
	@NotBlank @Length(max=1000)
	private java.lang.String titleDetail;
    /**
     * 帖子发表时间       db_column: title_create_time 
     */ 	
	@Length(max=20)
	private java.lang.String titleCreateTime;
    /**
     * 帖子状态       db_column: title_status 
     */ 	
	
	private java.lang.Integer titleStatus;
    /**
     * 帖子回复数       db_column: title_reply_num 
     */ 	
	
	private java.lang.Integer titleReplyNum;
    /**
     * 帖子最后回复用户id       db_column: title_last_reply_userid 
     */ 	
	
	private java.lang.Integer titleLastReplyUserid;
    /**
     * 最后回复用户       db_column: title_last_reply_username 
     */ 	
	@Length(max=50)
	private java.lang.String titleLastReplyUsername;
    /**
     * 最后回复时间       db_column: title_last_reply_time 
     */ 	
	@Length(max=20)
	private java.lang.String titleLastReplyTime;
    /**
     * 帖子发表人       db_column: title_userid 
     */ 	
	
	private java.lang.Integer titleUserid;
    /**
     * 版块id       db_column: title_blockid 
     */ 	
	
	private java.lang.Integer titleBlockid;
    /**
     * 是否置顶（0：置顶，1：不置顶）       db_column: title_istop 
     */ 	
	
	private java.lang.Integer titleIstop;
    /**
     * 帖子发表用户名称       db_column: title_username 
     */ 	
	@Length(max=50)
	private java.lang.String titleUsername;
	//columns END


	public BbsTitleInfo(){
	}

	public BbsTitleInfo(
		java.lang.Integer titleId
	){
		this.titleId = titleId;
	}

	

	public void setTitleId(java.lang.Integer value) {
		this.titleId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "title_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleId() {
		return this.titleId;
	}
	
	@Column(name = "title_title", unique = false, nullable = false, insertable = true, updatable = true, length = 100)
	public java.lang.String getTitleTitle() {
		return this.titleTitle;
	}
	
	public void setTitleTitle(java.lang.String value) {
		this.titleTitle = value;
	}
	
	@Column(name = "title_detail", unique = false, nullable = false, insertable = true, updatable = true, length = 1000)
	public java.lang.String getTitleDetail() {
		return this.titleDetail;
	}
	
	public void setTitleDetail(java.lang.String value) {
		this.titleDetail = value;
	}
	
	@Column(name = "title_create_time", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getTitleCreateTime() {
		return this.titleCreateTime;
	}
	
	public void setTitleCreateTime(java.lang.String value) {
		this.titleCreateTime = value;
	}
	
	@Column(name = "title_status", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleStatus() {
		return this.titleStatus;
	}
	
	public void setTitleStatus(java.lang.Integer value) {
		this.titleStatus = value;
	}
	
	@Column(name = "title_reply_num", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleReplyNum() {
		return this.titleReplyNum;
	}
	
	public void setTitleReplyNum(java.lang.Integer value) {
		this.titleReplyNum = value;
	}
	
	@Column(name = "title_last_reply_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleLastReplyUserid() {
		return this.titleLastReplyUserid;
	}
	
	public void setTitleLastReplyUserid(java.lang.Integer value) {
		this.titleLastReplyUserid = value;
	}
	
	@Column(name = "title_last_reply_username", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getTitleLastReplyUsername() {
		return this.titleLastReplyUsername;
	}
	
	public void setTitleLastReplyUsername(java.lang.String value) {
		this.titleLastReplyUsername = value;
	}
	
	@Column(name = "title_last_reply_time", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getTitleLastReplyTime() {
		return this.titleLastReplyTime;
	}
	
	public void setTitleLastReplyTime(java.lang.String value) {
		this.titleLastReplyTime = value;
	}
	
	@Column(name = "title_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleUserid() {
		return this.titleUserid;
	}
	
	public void setTitleUserid(java.lang.Integer value) {
		this.titleUserid = value;
	}
	
	@Column(name = "title_blockid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleBlockid() {
		return this.titleBlockid;
	}
	
	public void setTitleBlockid(java.lang.Integer value) {
		this.titleBlockid = value;
	}
	
	@Column(name = "title_istop", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getTitleIstop() {
		return this.titleIstop;
	}
	
	public void setTitleIstop(java.lang.Integer value) {
		this.titleIstop = value;
	}
	
	@Column(name = "title_username", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getTitleUsername() {
		return this.titleUsername;
	}
	
	public void setTitleUsername(java.lang.String value) {
		this.titleUsername = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("TitleId",getTitleId())
			.append("TitleTitle",getTitleTitle())
			.append("TitleDetail",getTitleDetail())
			.append("TitleCreateTime",getTitleCreateTime())
			.append("TitleStatus",getTitleStatus())
			.append("TitleReplyNum",getTitleReplyNum())
			.append("TitleLastReplyUserid",getTitleLastReplyUserid())
			.append("TitleLastReplyUsername",getTitleLastReplyUsername())
			.append("TitleLastReplyTime",getTitleLastReplyTime())
			.append("TitleUserid",getTitleUserid())
			.append("TitleBlockid",getTitleBlockid())
			.append("TitleIstop",getTitleIstop())
			.append("TitleUsername",getTitleUsername())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getTitleId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof BbsTitleInfo == false) return false;
		if(this == obj) return true;
		BbsTitleInfo other = (BbsTitleInfo)obj;
		return new EqualsBuilder()
			.append(getTitleId(),other.getTitleId())
			.isEquals();
	}
}

